package com.dankegongyu.push;

import android.app.Application;
import android.content.Context;
import android.util.Log;

import com.dankegongyu.component.push.DKPush;
import com.dankegongyu.component.push.DKPushReceiveListener;
import com.igexin.sdk.message.GTCmdMessage;
import com.igexin.sdk.message.GTNotificationMessage;
import com.igexin.sdk.message.GTTransmitMessage;

/**
 */
public class AppApplication extends Application {

    private static final String TAG = "推送测试1";

    @Override
    public void onCreate() {
        super.onCreate();

        init();
    }

    public void init() {
        DKPush.init(this, initSdkListener);
    }

    /**
     * SDK listener
     */
    private DKPushReceiveListener initSdkListener = new DKPushReceiveListener() {

        @Override
        public void onReceiveServicePid(Context context, int pid) {
            Log.d(TAG, "onReceiveServicePid: ");
        }

        //处理透传消息
        @Override
        public void onReceiveMessageData(Context context, GTTransmitMessage msg) {
            Log.d(TAG, "onReceiveMessageData: ");
        }

        //接收 cid
        @Override
        public void onReceiveClientId(Context context, String clientId) {
            Log.d(TAG, "onReceiveClientId: ");
        }

        //离线上线通知
        @Override
        public void onReceiveOnlineState(Context context, boolean online) {
            Log.d(TAG, "onReceiveOnlineState: ");
        }

        //各种事件处理回执
        @Override
        public void onReceiveCommandResult(Context context, GTCmdMessage cmdMessage) {
            Log.d(TAG, "onReceiveCommandResult: ");
        }

        //通知消息到达
        @Override
        public void onNotificationMessageArrived(Context context, GTNotificationMessage msg) {
            Log.d(TAG, "onNotificationMessageArrived: ");
        }

        //通知消息点击
        @Override
        public void onNotificationMessageClicked(Context context, GTNotificationMessage msg) {
            Log.d(TAG, "onNotificationMessageClicked: ");
        }
    };

}
